← Back to Devops Blogs

Logging & Monitoring Your Kubernetes Cluster on Minikube (Windows)

2025-07-23📖 3 min read

Share:

📊 Blog 6: Logging & Monitoring Your Kubernetes Cluster on Minikube (Windows)

Welcome to Part 6 of our DevOps with Angular & Minikube series! Now that your app is deployed and autoscaling, it’s crucial to observe what’s happening inside your cluster. This blog will guide you through basic logging and monitoring setup for Kubernetes on Minikube.


🤔 Why Logging & Monitoring?

  • Logging: Collecting records of events that happen in your application or system.
    • Why? Essential for debugging problems, understanding application behavior, and identifying performance issues. If something goes wrong, logs are your first line of defense to figure out "what happened?"
  • Monitoring: Continuously observing and collecting metrics (data) about the health, performance, and resource usage of your system.
    • Why? Helps you understand the current state of your cluster and applications, detect anomalies, predict potential issues (e.g., resource exhaustion), and ensure your services are running optimally before users are impacted. It allows you to be proactive rather than reactive.

🛠️ Tools We’ll Use

Tool Purpose Notes
Kubernetes Dashboard Visual cluster overview Built into Minikube
kubectl logs Fetch pod/container logs CLI-based, quick inspection
Metrics Server Provides CPU/memory metrics Already enabled in Blog 1
Prometheus + Grafana Advanced monitoring & dashboards Optional, can be set up later

⚙️ Step 1: Access Kubernetes Dashboard

Minikube includes a handy dashboard with a GUI to monitor your cluster.

Run:

minikube dashboard

This will open a browser tab showing:

  • Nodes and their status
  • Running pods, deployments, and replicasets
  • Resource usage graphs
  • Logs for individual pods

Use it to inspect your Angular app’s pods and their current status.


⚙️ Step 2: View Logs from Pods

To check logs from your Angular app pod, first get pod names:

kubectl get pods

Then fetch logs from a specific pod:

kubectl logs <pod-name>

Example:

kubectl logs angular-app-deployment-7fcbc7dfdf-frbb7

Use -f to follow logs live:

kubectl logs -f <pod-name>

This helps debug issues or verify app behavior.


⚙️ Step 3: Monitor Resource Usage

Run:

kubectl top nodes
kubectl top pods

You’ll see CPU and memory usage, helping you identify resource bottlenecks or abnormal behavior.


⚙️ Step 4 (Optional): Install Prometheus and Grafana for Advanced Monitoring

While metrics-server gives basic CPU/memory metrics, Prometheus and Grafana provide powerful dashboards and alerts.

You can deploy them easily on Minikube:

kubectl create namespace monitoring
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/bundle.yaml

Follow this official guide for detailed setup.

Grafana dashboards visualize metrics collected by Prometheus.


📝 Notes & Tips

  • For local dev, the Kubernetes Dashboard + kubectl logs are often enough.
  • On production clusters, central logging systems like ELK stack (Elasticsearch, Logstash, Kibana) or EFK (Elasticsearch, Fluentd, Kibana) are recommended.
  • Consider setting alerts on metrics to get notified when something goes wrong.

✅ Recap

You have learned:

  • How to open and use the Kubernetes Dashboard on Minikube
  • How to fetch and follow logs of your pods using kubectl logs
  • How to monitor resource usage with kubectl top commands
  • Optional path to advanced monitoring with Prometheus and Grafana